* (bug 24425) Use Database::replace instead of delete/insert in SqlBagOStuff::set...
authorRyan Schmidt <skizzerz@users.mediawiki.org>
Fri, 30 Jul 2010 19:56:49 +0000 (19:56 +0000)
committerRyan Schmidt <skizzerz@users.mediawiki.org>
Fri, 30 Jul 2010 19:56:49 +0000 (19:56 +0000)
RELEASE-NOTES
includes/BagOStuff.php

index f55d9a9..e2748d0 100644 (file)
@@ -258,6 +258,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   useful error message.
 * Uploading to a protected title will allow the user to choose a new name 
   instead of showing an error page
+* (bug 24425) Use Database::replace instead of delete/insert in SqlBagOStuff::set
+  to avoid query errors about duplicate keynames.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index fb57ad0..2e2ba01 100644 (file)
@@ -307,8 +307,9 @@ class SqlBagOStuff extends BagOStuff {
                }
                try {
                        $db->begin();
-                       $db->delete( 'objectcache', array( 'keyname' => $key ), __METHOD__ );
-                       $db->insert( 'objectcache',
+                       // (bug 24425) use a replace if the db supports it instead of
+                       // delete/insert to avoid clashes with conflicting keynames
+                       $db->replace( 'objectcache', array( 'keyname' ),
                                array(
                                        'keyname' => $key,
                                        'value' => $db->encodeBlob( $this->serialize( $value ) ),